<?php

namespace Reezy\AlipaySdk;


class AlipaySdkFactory implements AlipaySdkFactoryInterface
{
    private $sdks = [];

    public function get($name = 'default'): AlipaySdk {
        if (isset($this->sdks[$name])) {
            return $this->sdks[$name];
        }
        return $this->sdks[$name] = AlipaySdk::createWithConfig(\config("alipay.$name"));
    }
}